<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8"/>
    <title>Manual-player instantiation example</title>

    <script src="../../dist/dash.all.debug.js"></script>
    <!--dash.all.min.js should be used in production over dash.all.debug.js
        Debug files are not compressed or obfuscated making the file size much larger compared with dash.all.min.js-->
    <!--<script src="../../dist/dash.all.min.js"></script>-->

    <script class="code">
        function init() {
            var video,
                player,
                url = "https://dash.akamaized.net/envivio/EnvivioDash3/manifest.mpd";
            
            player = dashjs.MediaPlayer().create();
            video = document.querySelector("video");
            player.initialize(); // initialize the MediaPlayer instance
            player.getDebug().setLogToBrowserConsole(false); // turns off console logging
            player.setScheduleWhilePaused(false); // stops the player from loading segments while paused
            player.setFastSwitchEnabled(true); // enables buffer replacement when switching bitrates for faster switching
            player.setAutoPlay(false); // remove this line if you want the player to start automatically on load
            player.attachView(video); // tell the player which videoElement it should use
            player.attachSource(url); // provide the manifest source
            
        }
    </script>

    <style>
        video {
            width: 640px;
            height: 360px;
            background-color: #666666;
        }
    </style>
    </head>
    <body>
        <div>
            <video controls="true">
            </video>
        </div>
        <script>
            document.addEventListener("DOMContentLoaded", function () {
                init();
            });
        </script>
        <script src="../highlighter.js"></script>
    </body>
</html>
